<template>
  <div>
    <p>BBBB</p>
    <p>{{ count }}</p>
  </div>
</template>

<script>
export default {
  name: "B",
  data() {
    return {
      count: 0,
    };
  },
  mounted() {
    this.$globalEventBus.$on("update", this.update);
  },
  beforeDestroy() {
    this.$globalEventBus.$off("update", this.update);
  },
  methods: {
    update() {
      this.count++;
    },
  },
};
</script>

<style>
</style>